package com.cy.jt.common.domain;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors //开启链式加载
public class JsonResult implements Serializable {
    /*添加序列化ID*/
    private static final long serialVersionUID = 3279770143142198890L;
    /*响应状态码*/
    private int code=1; //ok ;0 error
    /*具体消息*/
    private String message="ok";
    /*一般对应查询结果*/
    private Object data;
    /*构造方法*/
    public JsonResult(){}
    public JsonResult(String message){
        this.message=message;
    }
    public JsonResult(Object data){
        this.data=data;
    }
    public JsonResult(Throwable e){
        this.data=0;
        this.message = e.getMessage();
    }
}
